package com.projects.xenia.add_activities;

import android.app.TabActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TabHost;

import com.projects.xenia.Activity_CustomersInfo;
import com.projects.xenia.MainDebtsDetailsActivity;
import com.projects.xenia.R;
import com.projects.xenia.journals_activities.Activity_JournalsTabs;


public class Activity_InfoTabs extends TabActivity {
	
	private TabHost tabHost;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	
		requestWindowFeature(Window.FEATURE_NO_TITLE);            
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
	
		setContentView(R.layout.info_tabs);
		
		Bundle DocExtra = getIntent().getExtras();
		
		String customer_id = DocExtra.getString("customer_id");
		int dayofroute = DocExtra.getInt("dayofroute",0);
		boolean journaltab = DocExtra.getBoolean("journaltab", false);
		
        tabHost = getTabHost();        
        
        TabHost.TabSpec tabSpec;
        
        if (journaltab) {
        	tabSpec = tabHost.newTabSpec("journals");
            tabSpec.setIndicator("",getResources().getDrawable(R.drawable.ic_visit));
            Intent journals = new Intent ();
            journals.setClass(this, Activity_JournalsTabs.class);
            journals.putExtra("customer_id",customer_id);
            tabSpec.setContent(journals);
            tabHost.addTab(tabSpec);
        }
        
        tabSpec = tabHost.newTabSpec("info");
        tabSpec.setIndicator("",getResources().getDrawable(R.drawable.ic_customerfolder));
        Intent Info = new Intent ().addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);;
        Info.setClass(this, Activity_CustomersInfo.class);
        Info.putExtra("CustomerId",customer_id);
        tabSpec.setContent(Info);
        tabHost.addTab(tabSpec);
        
        tabSpec = tabHost.newTabSpec("debts");
        tabSpec.setIndicator("",getResources().getDrawable(R.drawable.st_debts));
        Intent Debts = new Intent ().addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);;
        Debts.setClass(this, MainDebtsDetailsActivity.class);
        Debts.putExtra("Customer",customer_id);
        tabSpec.setContent(Debts);
        tabHost.addTab(tabSpec);
        
        tabSpec = tabHost.newTabSpec("map");
        tabSpec.setIndicator("",getResources().getDrawable(R.drawable.st_route));
        Intent MapForm = new Intent ().addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);;
        MapForm.setClass(this, Activity_Map.class);
        MapForm.putExtra("customer_id",customer_id);
        MapForm.putExtra("dayofroute",dayofroute);
        tabSpec.setContent(MapForm);
        tabHost.addTab(tabSpec);
       
        
        
        
     
	}

	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {	
		super.onActivityResult(requestCode, resultCode, data);
		
		
		
	}
	
	
}
